


$(document).ready(function () {
	getEventsAjax();
})


function getEventsAjax() {
	$.ajax({

		url: "/api/hools/get/by/event_id",
		type: 'POST',
		data: {
			csrfmiddlewaretoken: $.cookie('csrftoken'), // just the token value
			id: $('#event_id').val()
		},
		success: function (response) {
			$('#hools_table_body').html('');
			var hooligan = eval(response);
			for (i = 0; i < hooligan.length; i++) {
				$('#hools_table_body').append('<tr>' + '<td><input class="tabradio" type="radio" name="tab1" value="' + hooligan[i].id + '" /></td><td>' + hooligan[i].id + '</td>' + '<td class="name">' + hooligan[i].name + '</td>' + '<td class="lastname">' + hooligan[i].lastname + '</td>' + '<td><a href=\'/api/hools/img/' + hooligan[i].photoUrl + '\'"> img</a>' + '</td>' + '<td>' + hooligan[i].date + '</td>' + '<td>' + hooligan[i].user + '</td>' + '</tr>');
			}
		}
	});
}
function getSelectedId() {
	return $('input[name=tab1]:checked').val()
}